<template>
<div>
  <span class="el-descriptions__title">{{search}}跟进记录</span>
  <div class="el-input--mini" v-for="item in trackList">
    <el-row v-if="item.nextTime">
      <el-col :span="8"><span>下次跟进时间</span></el-col>
      <el-col :span="16"><span>{{parseTime(item.nextTime)}}</span></el-col>
    </el-row>
    <el-row v-if="item.level">
      <el-col :span="8"><span>意向等级</span></el-col>
      <el-col :span="16"><span>{{selectDictLabel(dict.type.clues_level,item.level)}}</span></el-col>
    </el-row>
    <el-row v-if="item.subject">
      <el-col :span="8"><span>意向学科</span></el-col>
      <el-col :span="16"><span>{{selectDictLabel(dict.type.course_subject,item.subject)}}</span></el-col>
    </el-row>
    <el-row v-if="item.nextTime">
      <el-col :span="8"><span>沟通内容</span></el-col>
      <el-col :span="16">
        <span v-for="keyId in item.keyitems" :key="keyId">
          {{selectDictLabel(dict.type.communication_point,keyId)}}
        </span>
      </el-col>
    </el-row>
    <el-row v-if="item.nextTime">
      <el-col :span="8"><span>记录人</span></el-col>
      <el-col :span="16"><span>{{item.operName}}</span></el-col>
    </el-row>
    <el-row v-if="item.nextTime">
      <el-col :span="8"><span>记录时间</span></el-col>
      <el-col :span="16"><span>{{(item.operTime)}}</span></el-col>
    </el-row>
    <el-row v-if="item.reason">
      <el-col :span="8"><span>伪线索原因</span></el-col>
      <el-col :span="16"><span>{{item.reason}}</span></el-col>
    </el-row>
    <el-row v-if="item.remark">
      <el-col :span="8"><span>伪线索详情</span></el-col>
      <el-col :span="16"><span>{{item.remark}}</span></el-col>
    </el-row>
    <el-row v-if="item.operName && item.recond">
      <el-col :span="8"><span>操作人名称</span></el-col>
      <el-col :span="16"><span>{{item.operName}}</span></el-col>
    </el-row>
    <el-row v-if="item.recond">
      <el-col :span="8"><span>操作人时间</span></el-col>
      <el-col :span="16"><span>{{parseTime(item.operTime)}}</span></el-col>
    </el-row>
    <el-row v-if="item.recond">
      <el-col :span="8"><span>详情</span></el-col>
      <el-col :span="16"><span>{{item.recond}}</span></el-col>
    </el-row>
  </div>
</div>
</template>

<script>
import {MongDbList} from "@/api/crm/clue";
import {parseTime, selectDictLabel} from "@/utils/ruoyi";

export default {
  name: "track-list",
  props:{
    search:{
      type:String,
      default:'线索'
    },
    id:{
      type:[Number,String],
      default: 0
    }
  },
  dicts: ["communication_point", "course_subject", "clues_level"],
  data(){
    return{
      trackList:[],
    }
  },methods:{
    getTrackList(){
      MongDbList({id:this.id,table:this.search}).then(resp =>{
        this.trackList = resp.rows;
      })
    }
  },created() {
    this.getTrackList();
  }
}
</script>

<style scoped>

</style>
